// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.beatmapsets-search {
  @_icon-width: @font-size--large + 5px;
  @_icon-width--sticky: @font-size--normal-2 + 5px;
  @_top: beatmapsets-search;
  background-color: @osu-colour-b6;
  position: relative;

  .default-box-shadow();
  .default-gutter-v2();
  padding-top: 10px;
  padding-bottom: $padding-top;
  font-size: @font-size--normal-2;

  &--sticky {
    background-color: transparent;
    margin: 0px;
    padding: 0px;
    box-shadow: none;
  }

  &__advanced {
    display: none;

    .@{_top}--expanded & {
      display: contents;
    }
  }

  &__cover {
    .full-size();
    opacity: 0.5;
    --border-radius: 0;

    &::after {
      .full-size();
      content: "";
      background-color: hsla(var(--hsl-b1), 80%);
    }
  }

  &__expand-link {
    grid-column: 1 / span 2;
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    font-size: @font-size--small;
    color: hsl(var(--hsl-c1));

    &:hover,
    &:active,
    &:focus {
      color: #fff;
    }

    .@{_top}--expanded & {
      display: none;
    }
  }

  &__filter-grid {
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: baseline;

    @media @desktop {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0 10px;
    }
  }

  &__filters {
    display: flex;
    justify-content: space-between;
  }

  &__icon {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: @_icon-width + 20px;
    display: flex;
    align-items: center;
    justify-content: center;

    .@{_top}--sticky & {
      width: @_icon-width--sticky + 20px;
    }
  }

  &__input {
    border: 1px solid @osu-colour-b4;
    width: 100%;
    padding: 10px;
    padding-right: 10px + @_icon-width + 20px;
    background-color: @osu-colour-b2;
    color: @osu-colour-c1;

    &:focus {
      outline: none;
      box-shadow: 0 0 10px @osu-colour-l1;
      border-color: @osu-colour-c1;
    }

    .@{_top}--sticky & {
      padding: 5px;
      padding-right: 5px + @_icon-width--sticky + 20px;
    }

    &[disabled] {
      background-color: @osu-colour-b2;
      border-color: @osu-colour-b4;
      color: @osu-colour-c1;
    }
  }

  &__input-container {
    color: @osu-colour-l1;
    font-size: @font-size--large;
    margin: 20px 0;
    position: relative;

    @media @desktop {
      margin-left: -10px;
      margin-right: $margin-left;
    }

    .@{_top}--sticky & {
      font-size: @font-size--normal-2;
      margin: 5px 0;
    }
  }
}
